<template>
  <div id="app">
    <el-container>
      <el-header>员工和部门</el-header>
      <el-container>
        <el-aside width="200px">
          <!--这里放菜单-->
          <el-menu
                  default-active="2"
                  class="el-menu-vertical-demo"
                  background-color="#545c64"
                  router
                  :default-active="$route.path"
                  text-color="#fff"
                  active-text-color="#ffd04b">
            <el-submenu :index="m.path + ''" v-for="m in menus" :key="m.id">
              <template slot="title">
                <i :class="m.icon"></i>
                <span>{{m.text}}</span>
              </template>
              <el-menu-item :index="m.path + '/' + child.path" v-for="child in m.children">
                <i :class="child.icon"></i>
                <span slot="title">{{child.text}}</span>
              </el-menu-item>
            </el-submenu>

          </el-menu>
        </el-aside>
        <el-main>
          <el-card shadow="hover">
            <router-view/>
          </el-card>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
  import menus from "@/assets/menu";

  export default {
    name: 'App',
    data(){
      return {
        menus
      }
    }
  }
</script>

<style>
  *{
    padding:0;
    margin:0;
  }
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: right;
    line-height: 60px;

  }

  .el-menu-item{
    margin-left:20px;

  }
  /*以下代表去除菜单中右侧边框*/
  .el-menu{
    border:0!important;
  }
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    height:1000px;
    /*line-height: 200px;*/
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
